<template>
  <div class="content">
    <el-form ref="form" :model="form">
      <div class="search">
        <el-form-item label="姓名" class="label">
          <el-input v-model="form.name" class="input" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="身份证" class="label">
          <el-input v-model="form.name" class="input" placeholder="请输入身份证" />
        </el-form-item>
        <el-form-item label="行政区划" class="label">
          <el-select placeholder="请选择行政区划" class="input" />
          <!--  <el-input v-model="form.name" class="input"></el-input> -->
        </el-form-item>
        <el-form-item>
          <el-button type="primary" size="mini" @click="onSubmit">查询</el-button>
        </el-form-item>
         <el-form-item style="width:100%;">
           <div style="float:right;">
              <img src="../../assets/T通用按钮/按钮/导出.png" alt="">
           </div>

        </el-form-item>
      </div>
    </el-form>
    <el-table
      ref="singleTable"
      :data="tableData"
      :header-cell-style="{background: '#EBECF0',height:'44px',color:'#000000'}"
      :cell-style="{background: '#ffffff',height:'44px',color:'#000000'}"
      highlight-current-row
      style="width: 100%"
      @current-change="handleCurrentChange"
    >
      <el-table-column label="序号" type="index" width="100" />
      <el-table-column property="time" label="时间"  />
      <el-table-column property="community" label="小区"  />
      <el-table-column property="camerId" label="摄像头" />
      <el-table-column property="name" label="姓名" />
      <el-table-column property="address" label="身份证">
        <template slot-scope="scope">{{ scope.row.idCard | hideidCard }}</template>
      </el-table-column>
      <el-table-column property="address" label="图片" width="150">
        <template slot-scope="scope">
          <img :src="scope.row.img" class="img" alt @click="showImg(scope.row.img)" />
        </template>
      </el-table-column>
    </el-table>
    <div class="pagination">
      <el-pagination
        :current-page.sync="page"
        background
        :page-sizes="[10, 20, 30, 40]"
        layout="total, prev, pager, next, jumper"
        :total="total"
        @current-change="handleCurrentChange"
      />
    </div>
    <!-- 图片放大 -->
    <img-dialog v-if="isShownimg" :img="chooseImg" @closeImg="closeImg" />
  </div>
</template>

<script>
import { mapGetters } from "vuex";
import ImgDialog from "@/components/Imgdialog";

export default {
  name: "Dashboard",
  components: {
    ImgDialog
  },
  data() {
    return {
      form: {},
      tableData: [
        {
          community:'新丰苑三期',
          time:'2020-10-23 12:23:23',
          name: "111",
          idCard: "320211199604241936",
          camerId:"sadj",
          img:
            "https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/b3b39c89c7384b9e8fae08d35660e1b7~tplv-k3u1fbpfcp-watermark.image"
        }
      ],
      total: 100,
      page: 10,
      isShownimg: false,
      chooseImg: null
    };
  },
  computed: {
    ...mapGetters(["communityId"])
  },
  watch: {
    communityId(newVal, oldVal) {
      console.log("changed");
    }
  },
  created() {},
  methods: {
    showImg(img) {
      this.isShownimg = true;
      this.chooseImg = img;
    },
    closeImg() {
      this.isShownimg = false;
    }
  }
};
</script>
<style lang="scss" scoped>
.content {
  background: #ffffff;
  padding: 25px;
  padding-bottom: 100px;
  min-height: 800px;
  position: relative;
  .search {
    display: flex;
    align-items: flex-end;
    border-bottom: 2px solid #dcdee3;
    margin-bottom: 30px;
    img {
      vertical-align: middle;
    }
  }
  .input {
    width: 346px;
  }
  .label {
    margin-right: 20px;
    color: #666666;
    font-size: 14px;
  }
  .pagination {
    position: absolute;
    right: 0;
    bottom: 0;
    margin: 50px;
  }
  .img {
    width: 50px;
    height: 34px;
  }
}
</style>
<style>
.input .el-input__inner {
  height: 28px !important;
}
</style>
